package cn.eonshine.cuba.inf.modular.basic.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.eonshine.base.core.base.controller.BaseController;
import cn.eonshine.cuba.inf.common.http.Message;
import cn.eonshine.cuba.inf.modular.basic.service.IInfRoadTankerSubtableService;

/**
 * 控制器
 *
 * @author fengshuonan
 * @Date 2018-10-22 16:47:47
 */
@Controller
@RequestMapping("/infRoadTankerSubtable")
public class InfRoadTankerSubtableController extends BaseController {

    @Autowired
    private IInfRoadTankerSubtableService iInfRoadTankerSubtableService;


    @Value("${data.isUpdate:0}")
    private int isUpdate;
    
    @RequestMapping(value = "/list")
    @ResponseBody
    public Message list(@RequestBody Message message) {
        return iInfRoadTankerSubtableService.queryDataList(message);
    }

    @RequestMapping(value = "/delete")
    @ResponseBody
    public Object delete(@RequestParam Integer infRoadTankerMasterId) {
    	iInfRoadTankerSubtableService.removeById(infRoadTankerMasterId);
        return SUCCESS_TIP;
    }

    @RequestMapping(value = "/update")
    @ResponseBody
    public Message update(@RequestBody Message message) {
    	return iInfRoadTankerSubtableService.changeLsmsUpdate(message, isUpdate);
    }
}
